import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 * 
 * Gui of search book window for the user's use
 */
public class SearchBookGUI extends JPanel implements ActionListener, ListSelectionListener
{

	

	public static final long serialVersionUID = 1L;
	public JLabel MainTitle = null;
	public JLabel Field1 = null;
	/** Title Label */
	public JLabel jLabel1 = null;
	/** Author Label */
	public JLabel jLabel2 = null;
	/** Language Label */
	public JLabel jLabel3 = null;
	/** Keywords Label */
	public JLabel jLabel4 = null;
	/** Summary Label */
	public JLabel jLabel5 = null;
	/** Index Label */
	public JLabel jLabel6 = null;
	/** Format Label */
	public JLabel jLabel7 = null;
	/** Field Label */
	public JLabel jLabel8 = null;
	/** Subject Label */
	public JLabel jLabel9 = null;
	public JComboBox SubjectCombo = null;
	public JComboBox FieldCombo = null;
	/** Search result Label */
	public JLabel jLabel10 = null;
	public  JList SearchResult = null;
	public JButton Search1 = null;
	public JButton UpDate1 = null;
	public JButton RemoveFC = null;
	public JButton addTC = null;
	public JButton AddNewBook = null;
	public JButton Back1 = null;
	public JButton BookD = null;
	public JScrollPane jScrollPane = null;
	public JCheckBox jCheckPdf = null;
	public JCheckBox jCheckDoc = null;
	public JCheckBox jCheckFb2 = null;
	public JLabel jLabelPdf = null;
	public JLabel jLabelDoc = null;
	public JLabel jLabelFB2 = null;
	public JLabel jLabelPrice = null;
	public JTextField jPriceField = null;
	public JScrollPane jScrollTitle = null;
	public JTextField jTitleField = null;
	public JScrollPane jScrollAuthor = null;
	public JTextField jAuthorField = null;
	public JScrollPane jScrollLanguage = null;
	public JTextField jLanguageField = null;
	public JScrollPane jScrollKeyWords = null;
	public JTextField jKeyWordsField = null;
	public JScrollPane jScrollSummery = null;
	public JTextField jSummeryField = null;
	public JScrollPane jScrollIndex = null;
	public JTextField jIndexField = null;
	public JButton logout1 = null;
	public JLabel jResSerialLabel = null;
	public JLabel jResTitleLabel = null;
	public JLabel jResAuthorLabel = null;
	public JScrollPane jScrollResAuthor = null;
	public JList jAuthorList = null;
	public JButton jLironButton = null;
	public JButton jLironButton2 = null;
	public int flag=0;
	
	/**
	 * This is the default constructor
	 */
	public SearchBookGUI() {
		super();
		initialize();
	}
	/**
	 * This method initializes search book Gui
	 * 
	 * @return void
	 */
	public void initialize() {
		Main.searchBookC.o_GetSubjects();
		jResAuthorLabel = new JLabel();
		jResAuthorLabel.setBounds(new Rectangle(565, 125, 45, 16));
		jResAuthorLabel.setText("Author:");
		jResTitleLabel = new JLabel();
		jResTitleLabel.setBounds(new Rectangle(300, 88, 45, 16));
		jResTitleLabel.setText("Title");
		jResSerialLabel = new JLabel();
		jResSerialLabel.setBounds(new Rectangle(260, 88, 45, 16));
		jResSerialLabel.setText("Serial:");
		SubjectCombo=new JComboBox(Main.searchBookC.res);
		SubjectCombo.setBounds(new Rectangle(80, 355, 100, 30));
		this.add(SubjectCombo,null);
		Main.searchBookC.o_GetFields();
		FieldCombo = new JComboBox(Main.searchBookC.res);				
		FieldCombo.setBounds(new Rectangle(80, 395, 100, 30));
		this.add(FieldCombo,null);
		
		
		jLabelPrice = new JLabel();
		jLabelPrice.setBounds(new Rectangle(10, 275, 35, 20));
		jLabelPrice.setText("Price:");
		jLabelFB2 = new JLabel();
		jLabelFB2.setBounds(new Rectangle(195, 435, 30, 20));
		jLabelFB2.setText("FB2");
		jLabelDoc = new JLabel();
		jLabelDoc.setBounds(new Rectangle(140, 435, 30, 20));
		jLabelDoc.setText("DOC");
		jLabelPdf = new JLabel();
		jLabelPdf.setBounds(new Rectangle(90, 435, 30, 20));
		jLabelPdf.setText("PDF");
		jLabel10 = new JLabel();
		jLabel10.setBounds(new Rectangle(383, 61, 104, 14));
		jLabel10.setText("Search Result");
		jLabel9 = new JLabel();
		jLabel9.setBounds(new Rectangle(10, 355, 62, 14));
		jLabel9.setText("Subject:");
		jLabel8 = new JLabel();
		jLabel8.setBounds(new Rectangle(10, 395, 61, 14));
		jLabel8.setText("Field:");
		jLabel7 = new JLabel();
		jLabel7.setBounds(new Rectangle(10, 435, 62, 14));
		jLabel7.setText("Format:");
		jLabel6 = new JLabel();
		jLabel6.setBounds(new Rectangle(10, 235, 60, 14));
		jLabel6.setText("Index:");
		jLabel5 = new JLabel();
		jLabel5.setBounds(new Rectangle(10, 315, 60, 14));
		jLabel5.setText("Summary:");
		jLabel4 = new JLabel();
		jLabel4.setBounds(new Rectangle(10, 195, 74, 14));
		jLabel4.setText("KeyWords:");
		jLabel3 = new JLabel();
		jLabel3.setBounds(new Rectangle(10, 155, 67, 14));
		jLabel3.setText("Language:");
		jLabel2 = new JLabel();
		jLabel2.setBounds(new Rectangle(10, 115, 51, 14));
		jLabel2.setText("Author:");
		jLabel1 = new JLabel();
		jLabel1.setBounds(new Rectangle(10, 75, 33, 14));
		jLabel1.setText("Title:");
		Field1 = new JLabel();
		Field1.setBounds(new Rectangle(10, 45, 93, 15));
		Field1.setText("Search Fields :");
		MainTitle = new JLabel();
		MainTitle.setBounds(new Rectangle(260, 11, 150, 23));
		MainTitle.setText("Search Book");
		MainTitle.setFont(new Font(Font.SANS_SERIF ,Font.ITALIC,20));
		MainTitle.setBounds(200,20,300,50);
		this.setSize(720, 530);
		this.setLayout(null);
		this.add(MainTitle, null);
		this.add(Field1, null);
		this.add(jLabel1, null);
		this.add(jLabel2, null);
		this.add(jLabel3, null);
		this.add(jLabel4, null);
		this.add(jLabel5, null);
		this.add(jLabel6, null);
		this.add(jLabel7, null);
		this.add(jLabel8, null);
		this.add(jLabel9, null);
		this.add(jLabel10, null);
		this.add(getSearch1(), null);
		this.add(getUpDate1(), null);
		this.add(getRemoveFC(), null);
		this.add(getAddTC(), null);
		this.add(getAddNewBook(), null);
		this.add(getBack1(), null);
		this.add(getAllBD(), null);
		this.add(getJScrollPane(), null);
		this.setEnabled(false);
		this.setVisible(false);
		this.add(getJCheckPdf(), null);
		this.add(getJCheckDoc(), null);
		this.add(getJCheckFb2(), null);
		this.add(jLabelPdf, null);
		this.add(jLabelDoc, null);
		this.add(jLabelFB2, null);
		this.add(jLabelPrice, null);
		this.add(getJPriceField(), null);
		this.add(getJScrollTitle(), null);
		this.add(getJScrollAuthor(), null);
		this.add(getJScrollLanguage(), null);
		this.add(getJScrollKeyWords(), null);
		this.add(getJScrollSummery(), null);
		this.add(getJScrollIndex(), null);
		this.add(getLogout1(), null);
		this.add(jResSerialLabel, null);
		this.add(jResTitleLabel, null);
		this.add(jResAuthorLabel, null);
		this.add(getJScrollResAuthor(), null);
		this.add(getJLironButton(), null);
		this.add(getJLironButton2(), null);
	}

	/**
	 * This method initializes SearchResult	
	 * 	
	 * @return javax.swing.JList	
	 */
	public JList getSearchResult() 
	{
		if (SearchResult == null)
		{
			SearchResult = new JList();
		
		}
		
		return SearchResult;
	}

	/**
	 * This method initializes Search1 button and set listener on this button
	 * 	
	 * @return javax.swing.JButton	
	 */
	public JButton getSearch1() {
		if (Search1 == null) {
			Search1 = new JButton();
			Search1.setBounds(new Rectangle(254, 393, 100, 20));
			Search1.setText("Search");
			Search1.addActionListener(this);
		}
		return Search1;
	}

	/**
	 * This method initializes UpDate1 button and set this button visible according to the user authorizations 	and book management flag
	 * and set listener on this button
	 * @return javax.swing.JButton	
	 */
	public JButton getUpDate1() {
		if (UpDate1 == null) {
			UpDate1 = new JButton();
			UpDate1.setBounds(new Rectangle(554, 438, 100, 20));
			UpDate1.setText("UpDate");
			UpDate1.addActionListener(this);
			if ((Main.gusers.authorozations != 1) && (Main.bookManagement.BMflage))
			{
				UpDate1.setEnabled(true);
				UpDate1.setVisible(true);
			}
			else
			{
				UpDate1.setEnabled(false);
				UpDate1.setVisible(false);
			}
		}
		return UpDate1;
	}

	/**
	 * This method initializes RemoveFC button and set this button visible according to the user authorizations and book management flag	
	 * and set listener on this button
	 * @return javax.swing.JButton	
	 */
	public JButton getRemoveFC() {
		if (RemoveFC == null) {
			RemoveFC = new JButton();
			RemoveFC.setBounds(new Rectangle(254, 438, 103, 20));
			RemoveFC.setText("Remove FC");
			RemoveFC.addActionListener(this);
			if ((Main.gusers.authorozations == 3) && (Main.bookManagement.BMflage))
			{
				RemoveFC.setEnabled(true);
				RemoveFC.setVisible(true);
			}
			else
			{
				RemoveFC.setEnabled(false);
				RemoveFC.setVisible(false);
			}
		}
		return RemoveFC;
	}

	/**
	 * This method initializes addTC button and set listener on this button
	 * 
	 * @return javax.swing.JButton	
	 */
	public JButton getAddTC() {
		if (addTC == null) {
			addTC = new JButton();
			addTC.setBounds(new Rectangle(554, 393, 100, 20));
			addTC.setText("Add To Cart");
			addTC.addActionListener(this);
		}
		return addTC;
	}

	/**
	 * This method initializes AddNewBook button and set this button visible according to the user authorizations and book management flag	
	 * and set listener on this button
	 * @return javax.swing.JButton	
	 */
	public JButton getAddNewBook() {
		if (AddNewBook == null) {
			AddNewBook = new JButton();
			AddNewBook.setBounds(new Rectangle(404, 438, 106, 20));
			AddNewBook.setText("Add Book");
			AddNewBook.addActionListener(this);
			if ((Main.gusers.authorozations != 1) && (Main.bookManagement.BMflage))
			{
				AddNewBook.setEnabled(true);
				AddNewBook.setVisible(true);
			}
			else
			{
				AddNewBook.setEnabled(false);
				AddNewBook.setVisible(false);
			}
		}
		return AddNewBook;
	}
	/**
	 * This method initializes Back1 button and set listener on this button
	 * @return javax.swing.JButton	
	 */
	public JButton getBack1() {
		if (Back1 == null) {
			Back1 = new JButton();
			Back1.setBounds(new Rectangle(570, 60, 90, 30));
			Back1.setText("Back");
			Back1.addActionListener(this);
		}
		return Back1;
	}
	/**
	 * This method initializes BookD button and set listener on this button
	 * @return javax.swing.JButton	
	 */
	public JButton getAllBD() 
	{
		if (BookD == null) {
			BookD = new JButton();
			BookD.setBounds(new Rectangle(404, 393, 111, 20));
			BookD.setText("Book Details");
			BookD.addActionListener(this);
		}
		return BookD;
	}
	/**
	 * This method initializes jScrollPane and set portview on Search Result JList
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setBounds(new Rectangle(260, 115, 300, 250));
			jScrollPane.setViewportView(getSearchResult());
		}
		return jScrollPane;
	}
	/**
	 * This method initializes logout1 button and set listener on this button
	 * @return javax.swing.JButton	
	 */
	public JButton getLogout1() {
		if (logout1 == null) {
			logout1 = new JButton("Logout");
			logout1.setBounds(new Rectangle(570, 20, 90, 30));
			logout1.addActionListener(this);
		}
		return logout1;
	}


	@Override
	/**
	 * this method is activated when one of the listeners was triggered 
	 */
	public void actionPerformed(ActionEvent ae)
	{
		if(ae.getSource()== getBack1())
		{
			if(flag==0)
			{
				this.setEnabled(false);
				this.setVisible(false);
				Main.searchBookC.Back();
			}
			else
			{
				flag=0;
				this.setEnabled(false);
				this.setVisible(false);
				
				Main.searchBookC.Back();
				
			}
		}
		if(ae.getSource()== getSearch1())
		{
			Object[] options = {"Wide Search(OR between values)","Exact Search(AND between values)"};
			int n=JOptionPane.showOptionDialog(null,"Please select Search Type yo want to execute: ","Search Book",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[1]);
			Main.searchBookC.Search(n);
		}
		if(ae.getSource()== getUpDate1())
		{
			if(!(Main.searchBookC.seflag))
	    	{
	    		 JOptionPane.showMessageDialog(null,"Please execute Search before!!!","ERROR",JOptionPane.ERROR_MESSAGE);
	    		 return;
	    	}
			else
				Main.searchBookC.UpDate();
		}
		if(ae.getSource()== getAllBD())
		{
			if(!(Main.searchBookC.seflag))
	    	{
	    		 JOptionPane.showMessageDialog(null,"Please execute Search before!!!","ERROR",JOptionPane.ERROR_MESSAGE);
	    		 return;
	    	}
			else if (Main.searchBookG.SearchResult.getSelectedValue() == null)
				 {
						JOptionPane.showMessageDialog(null,"Please choose a book ","ERROR",JOptionPane.ERROR_MESSAGE);
						return;
				 }
			else 
				Main.searchBookC.all_details();
		}
		if (ae.getSource() == getAddNewBook())
		{
			Main.searchBookC.add_Book();
		}
		if(ae.getSource()== getRemoveFC())
		{
			if(!(Main.searchBookC.seflag))
	    	{
	    		 JOptionPane.showMessageDialog(null,"Please execute Search before!!!","ERROR",JOptionPane.ERROR_MESSAGE);
	    		 return;
	    	}
			else if (Main.searchBookG.SearchResult.getSelectedValue() == null)
				 {
						JOptionPane.showMessageDialog(null,"Please choose a book ","ERROR",JOptionPane.ERROR_MESSAGE);
						return;
				 }
			else 
			{
				Main.searchBookG.setEnabled(false);
				Main.searchBookG.setVisible(false);
				Main.removeFromCC = new RemoveBFCControl();
				Main.removeFromCG = new RemoveBFCGui();
				Main.removeFromCG.setSize(680,450);
				Main.log.frame.add(Main.removeFromCG);
				Main.removeFromCG.setEnabled(true);
				Main.removeFromCG.setVisible(true);
			}
		}
		if(ae.getSource()== getAddTC())
		{
			if(!(Main.searchBookC.seflag))
	    	{
	    		 JOptionPane.showMessageDialog(null,"Please execute Search before!!!","ERROR",JOptionPane.ERROR_MESSAGE);
	    		 return;
	    	}
			else if (Main.searchBookG.SearchResult.getSelectedValue() == null)
				 {
						JOptionPane.showMessageDialog(null,"Please choose a book ","ERROR",JOptionPane.ERROR_MESSAGE);
						return;
				 }
			else
			{
				String value = (String) Main.searchBookG.SearchResult.getSelectedValue();
				Boolean[] formats=new Boolean[3];
				Main.welcomeScreen.d_Retrieve_Set(value);
				for(int i=0;i<3;i++)
					formats[i]=false;
				if(Main.welcomeScreen.res[5].equals("yes"))
					formats[0]=true;
				if(Main.welcomeScreen.res[6].equals("yes"))
					formats[1]=true;
				if(Main.welcomeScreen.res[7].equals("yes"))
					formats[2]=true;
				AddToCart a=new AddToCart(Main.log.frame,formats,Main.welcomeScreen.res2,Main.welcomeScreen.res[0]);
				a.setVisible(true);
				
			}
		}
		if(ae.getSource()==getLogout1())
		{
			
			if(JOptionPane.showConfirmDialog(null, "Are you sure you want to logout ?","Confirmation", 0) == 0)
			{
				this.setEnabled(false);
				this.setVisible(false);
				Main.log.loginData=new String[3]; //GIL
				Main.log.loginData[0]=Main.gusers.id;
				Main.log.loginData[1]="logout";
				Main.log.loginData[2]=Main.gusers.id;
				Main.log.connection.accept("logout"); //GIL
				Main.log.flag=false;//GIL
				while(Main.log.flag==false);//GIL
				Main.log.flag=false;//GIL
				Main.log.user.setText("");
				Main.log.pass.setText("");
				Main.log.frame.setSize(650,550);
				Main.log.panel.setEnabled(true);
				Main.log.panel.setVisible(true);
			}
			
		}
		if(ae.getSource()==getJLironButton())
		{
			if(Main.searchBookG.SearchResult.getSelectedValue()!=null)
			{
				Main.brc.beg.setVisible(true);
				Main.brc.beg.setEnabled(true);
				Main.brc.lSearchBookp((String) Main.searchBookG.SearchResult.getSelectedValue());
			}
			else
				JOptionPane.showMessageDialog(null,"You Must search for a book and select a book in the list","ERROR",JOptionPane.ERROR_MESSAGE);
		}
		if(ae.getSource()==getJLironButton2())
		{
			if(Main.searchBookG.SearchResult.getSelectedValue()!=null)
			{
				Main.brc.beg.setVisible(true);
				Main.brc.beg.setEnabled(true);
				Main.brc.beg.dateUpload((String) Main.searchBookG.SearchResult.getSelectedValue());
			}
			else
				JOptionPane.showMessageDialog(null,"You Must search for a book and select a book in the list","ERROR",JOptionPane.ERROR_MESSAGE);
		}
		
	}	

	@Override
	public void valueChanged(ListSelectionEvent arg0)
	{
		
		
	}

	/**
	 * This method initializes jCheckPdf	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	public  JCheckBox getJCheckPdf() {
		if (jCheckPdf == null) {
			jCheckPdf = new JCheckBox();
			jCheckPdf.setBounds(new Rectangle(115, 435, 20, 20));
		}
		return jCheckPdf;
	}

	/**
	 * This method initializes jCheckDoc	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	public  JCheckBox getJCheckDoc() {
		if (jCheckDoc == null) {
			jCheckDoc = new JCheckBox();
			jCheckDoc.setBounds(new Rectangle(165, 435, 26, 20));
		}
		return jCheckDoc;
	}

	/**
	 * This method initializes jCheckFb2	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	public  JCheckBox getJCheckFb2() {
		if (jCheckFb2 == null) {
			jCheckFb2 = new JCheckBox();
			jCheckFb2.setBounds(new Rectangle(220, 435, 26, 20));
		}
		return jCheckFb2;
	}

	/**
	 * This method initializes jPriceField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJPriceField() {
		if (jPriceField == null) {
			jPriceField = new JTextField();
			jPriceField.setBounds(new Rectangle(80, 275, 145, 35));
		}
		return jPriceField;
	}

	/**
	 * This method initializes jScrollTitle	and set Portview on Price TextField 
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollTitle() {
		if (jScrollTitle == null) {
			jScrollTitle = new JScrollPane();
			jScrollTitle.setBounds(new Rectangle(80, 75, 145, 35));
			jScrollTitle.setViewportView(getJTitleField());
		}
		return jScrollTitle;
	}

	/**
	 * This method initializes jTitleField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJTitleField() {
		if (jTitleField == null) {
			jTitleField = new JTextField();
		}
		return jTitleField;
	}

	/**
	 * This method initializes jScrollAuthor and set Portview on Author TextField
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollAuthor() {
		if (jScrollAuthor == null) {
			jScrollAuthor = new JScrollPane();
			jScrollAuthor.setBounds(new Rectangle(80, 115, 145, 35));
			jScrollAuthor.setViewportView(getJAuthorField());
		}
		return jScrollAuthor;
	}

	/**
	 * This method initializes jAuthorField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJAuthorField() {
		if (jAuthorField == null) {
			jAuthorField = new JTextField();
		}
		return jAuthorField;
	}

	/**
	 * This method initializes jScrollLanguage and set Portview on Language TextField
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollLanguage() {
		if (jScrollLanguage == null) {
			jScrollLanguage = new JScrollPane();
			jScrollLanguage.setBounds(new Rectangle(80, 155, 145,35));
			jScrollLanguage.setViewportView(getJLanguageField());
		}
		return jScrollLanguage;
	}

	/**
	 * This method initializes jLanguageField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJLanguageField() {
		if (jLanguageField == null) {
			jLanguageField = new JTextField();
		}
		return jLanguageField;
	}

	/**
	 * This method initializes jScrollKeyWords and set Portview on KeyWords TextField
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollKeyWords() {
		if (jScrollKeyWords == null) {
			jScrollKeyWords = new JScrollPane();
			jScrollKeyWords.setBounds(new Rectangle(80, 195, 145, 35));
			jScrollKeyWords.setViewportView(getJKeyWordsField());
		}
		return jScrollKeyWords;
	}

	/**
	 * This method initializes jKeyWordsField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJKeyWordsField() {
		if (jKeyWordsField == null) {
			jKeyWordsField = new JTextField();
		}
		return jKeyWordsField;
	}

	/**
	 * This method initializes jScrollSummery	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollSummery() {
		if (jScrollSummery == null) {
			jScrollSummery = new JScrollPane();
			jScrollSummery.setBounds(new Rectangle(80, 315, 145, 35));
			jScrollSummery.setViewportView(getJSummeryField());
		}
		return jScrollSummery;
	}

	/**
	 * This method initializes jSummeryField and set Portview on Summery TextField
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJSummeryField() {
		if (jSummeryField == null) {
			jSummeryField = new JTextField();
		}
		return jSummeryField;
	}

	/**
	 * This method initializes jScrollIndex	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollIndex() {
		if (jScrollIndex == null) {
			jScrollIndex = new JScrollPane();
			jScrollIndex.setBounds(new Rectangle(80, 235, 145, 35));
			jScrollIndex.setViewportView(getJIndexField());
		}
		return jScrollIndex;
	}

	/**
	 * This method initializes jIndexField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	public JTextField getJIndexField() {
		if (jIndexField == null) {
			jIndexField = new JTextField();
		}
		return jIndexField;
	}

	/**
	 * This method initializes jScrollResAuthor	and set Portview on Author JList
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	public JScrollPane getJScrollResAuthor() {
		if (jScrollResAuthor == null) {
			jScrollResAuthor = new JScrollPane();
			jScrollResAuthor.setBounds(new Rectangle(565, 150, 145, 105));
			jScrollResAuthor.setViewportView(getJAuthorList());
		}
		return jScrollResAuthor;
	}

	/**
	 * This method initializes jAuthorList 
	 * 	
	 * @return javax.swing.JList
	 */
	public JList getJAuthorList() {
		if (jAuthorList == null) {
			jAuthorList = new JList();
		}
		return jAuthorList;
	}

	/**
	 * This method initializes jLironButton	and set listener on this button
	 * 	
	 * @return javax.swing.JButton	
	 */
	public JButton getJLironButton() {
		if (jLironButton == null) {
			jLironButton = new JButton();
			jLironButton.setBounds(new Rectangle(570, 285, 138, 32));
			jLironButton.setText("Book Popularity");
			jLironButton.setVisible(false);
			jLironButton.addActionListener(this);
		}
		return jLironButton;
	}
	/**
	 * This method initializes jLironButton2 and set listener on this button
	 * 	
	 * @return javax.swing.JButton	
	 */
	public JButton getJLironButton2() {
		if (jLironButton2 == null) {
			jLironButton2 = new JButton();
			jLironButton2.setBounds(new Rectangle(570, 330, 138, 32));
			jLironButton2.setText("Book Statistics");
			jLironButton2.setVisible(false);
			jLironButton2.addActionListener(this);
		}
		return jLironButton2;
	}
	
	

}  //  @jve:decl-index=0:visual-constraint="2,15"
